<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div>
    <el-form ref="form" :model="maintain_record" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 维修记录 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="维修标题" prop="maintain_title">
              <el-input v-model="maintain_record.maintain_title" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="维修时间" prop="maintain_time">
              <el-date-picker v-model="maintain_record.maintain_time" type="date" style='width:100%' value-format="yyyy-MM-dd" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="维修人" prop="maintain_person">
              <el-input v-model="maintain_record.maintain_person" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="维修人电话" prop="maintain_tel">
              <el-input v-model="maintain_record.maintain_tel" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="说明" prop="maintain_explain">
              <el-input type="textarea" v-model="maintain_record.maintain_explain" ttparea=350></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <el-button @click="increaseMaintenRecordSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'IncreaseMaintenRecord',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        maintain_record: {
          maintain_title: null,
          maintain_time: null,
          maintain_person: null,
          maintain_tel: null,
          maintain_explain: null,
        },
        loading: false,
        rules: {}
      }
    },
    created() {},
    updated() {},
    mounted() {},
    methods: {
      increaseMaintenRecordSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/crm/sale/AfterSaleAction/increaseMaintenRecordSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.$router.replace("/redirect" + this.$route.fullPath);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
